﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ControlFace
{
    //信息 by Panny
    public class MessageDate
    {
        private string msg;
        public string Content
        {
            get { return msg; }
            set { msg = value; }
        }

        private DateTime msgDate;
        public DateTime MessageTime
        {
            get { return msgDate; }
            set { msgDate = value; }
        }
        public MessageDate(DateTime _date, string _msg)
        {
            this.msg = _msg;
            this.msgDate = _date;
        }
    }

    public class UserMessage : List<MessageDate>
    {
        
        public void Add(DateTime SendTime, string Content)
        {
            //base.Add(SendTime.ToString() + "|" + Content);
            base.Add(new MessageDate(SendTime, Content));

            if (this.CountChanged != null)
                this.CountChanged();
            new System.Media.SoundPlayer(Properties.Resources.Sound_Msg).Play();
        }

       

        public new void Clear()
        {
            base.Clear();

            if (this.CountChanged != null)
                this.CountChanged();
        }

        public delegate void CountChangedHandler();
        public event CountChangedHandler CountChanged;

        public static void Main()
        {

        }

    }
}
